import {PolylineEdge, PolylineEdgeModel} from "@logicflow/core";
 
class CustomPolylineModel extends PolylineEdgeModel {
    setAttributes() {
        this.offset = 20;
        this.text.editable=false
    }
    //设置线样式
    getEdgeStyle() {
        const style = super.getEdgeStyle();
        const { properties } = this;
        if (properties.isActived) {
            style.strokeDasharray = "4 4";
        }
        style.stroke = "#d51b1b";
        return style;
    }
    //设置文字样色
    getTextStyle() {
        //设置文字样色
        const style = super.getTextStyle();
        // style.color = "#3451F1";
        // style.fontSize = 30;
        // style.background.fill = "#F2F131";
        // console.log(style)
        return style;
    }
    //鼠标悬浮时样式
    getOutlineStyle() {
        const style = super.getOutlineStyle();
        // style.stroke = "";
        // style.hover.stroke = "red";
        return style;
    }
}
 
export default {
    type: "CustomPolyline",
    view: PolylineEdge,
    model: CustomPolylineModel,
};